using System.ComponentModel.DataAnnotations;

namespace BunnyEater.Common.Config.Dto
{
    /// <summary>
    /// 分页查询请求DTO
    /// </summary>
    public class PagedRequestDto
    {
        /// <summary>
        /// 页码（从1开始）
        /// </summary>
        [Range(1, int.MaxValue, ErrorMessage = "页码必须大于0")]
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        [Range(1, 1000, ErrorMessage = "每页大小必须在1-1000之间")]
        public int PageSize { get; set; } = 10;

        /// <summary>
        /// 排序字段
        /// </summary>
        public string? SortField { get; set; }

        /// <summary>
        /// 是否升序
        /// </summary>
        public bool IsAscending { get; set; } = true;

        /// <summary>
        /// 搜索关键词
        /// </summary>
        public string? SearchKeyword { get; set; }
    }

    /// <summary>
    /// 分页查询请求DTO（带时间范围）
    /// </summary>
    public class PagedRequestWithDateRangeDto : PagedRequestDto
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndDate { get; set; }
    }

    /// <summary>
    /// 分页查询请求DTO（带状态筛选）
    /// </summary>
    public class PagedRequestWithStatusDto : PagedRequestDto
    {
        /// <summary>
        /// 状态
        /// </summary>
        public int? Status { get; set; }
    }
}